#include "mystdio.h"
#include <unistd.h>

int main()
{
    myFILE* fp = myfopen("log.txt", "w");
    if(fp == NULL)
    {
        printf("myfopen failed\n");
        return 1;
    }

    const char* msg = "hello world";
    int cnt = 10;
    while(cnt--)
    {
        myfputs(msg, fp);
        sleep(1);
        printf("debug: outbuffer: %s, pos: %d\n", fp->outbuffer, fp->pos);
    }

    myfclose(fp);

    return 0;
}
